<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>virt-vue3</title>
</head>
<body>
  <div id="app"></div>
  <script>
    let data = {
      msg: 'hello'
    }

    let vm = new Proxy(data, {
      get (target, key) {
        console.log('get:', key, target[key])
        return target[key]
      },
      set (target, key, newValue) {
        console.log('set:', key, newValue)
        if(target[key] === newValue) return
        target[key] = newValue
        document.querySelector('#app').textContent = target[key]
      }
    })

    console.log(vm.msg)

    vm.msg = 'hello app'
  </script>
</body>
</html>